home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / IT212.ZIP / MIDI.TXT < prev    next >
Encoding:
Text File  |  1997-04-22  |  16.6 KB  |  390 lines

  1.  
  2. -------------------------------------
  3. ## Impulse Tracker MIDI Supplement ##
  4. -------------------------------------
  5.  
  6. Introduction
  7. ============
  8.  
  9. The biggest new addition to Impulse Tracker 2.12 has been support for
  10. sending data out through the MIDI protocol. Earlier versions of Impulse
  11. Tracker (IT) have had support for incoming MIDI data, so it was possible to
  12. play on a 'MIDIfied' keyboard and have IT 'track' all the notes down in the
  13. pattern in realtime.
  14.  
  15. MIDI out, however, is a completely different ballgame. You in fact don't
  16. have to read this supplement at all if you wish to get MIDI working, but in
  17. order to gain full usage of MIDI out, you will have to read this in order
  18. to understand how IT's MIDI support fully works
  19.  
  20.  
  21. MIDI Support & Soundcards
  22. =========================
  23.  
  24. At present, the only sound devices IT supports for MIDI output are the AMD
  25. InterWave and the Creative Labs Sound Blaster AWE32. No planned support has
  26. been done for other sound devices. Do NOT bug Pulse to add MIDI out support
  27. for your soundcard, your mail will simply be deleted.
  28.  
  29.  
  30. Enabling MIDI
  31. =============
  32.  
  33. To enable MIDI output, you must first have IT on Instrument control mode
  34. rather than Sample control mode. To do this, press F12 to go to the Song
  35. Variables screen and switch control to 'Instruments' if you haven't already
  36. done so.
  37.  
  38. MIDI & Instruments
  39. ==================
  40.  
  41. MIDI Channel
  42. ------------
  43.  
  44. New to the Pitch section of the Instrument screen (press F4 and select the
  45. "Pitch" button) are the sliders "MIDI Channel", "MIDI Program" and "MIDI
  46. Bank". Once the MIDI Channel value for that instrument is set to a value
  47. other than zero, IT will send out MIDI data whenever that instrument is
  48. encountered in a pattern, on that particular MIDI Channel. What data IT
  49. actually sends through the MIDI port will be a note on command, although
  50. this will be discussed in more detail later.
  51.  
  52. MIDI Program/MIDI Bank
  53. ----------------------
  54.  
  55. The MIDI Program and MIDI Bank sliders work in a similar manner to each
  56. other. If they have a value set to -1, IT will not transmit a program change
  57. message nor a bank change message for that instrument. If you specifically
  58. set a MIDI Program for that instrument, IT will send a 'program change'
  59. message along with the 'note on' message.
  60.  
  61. The MIDI Bank instrument setting is also the same; IT will not send a bank
  62. change message if the MIDI Bank slider is set to Off (ie: has a value of
  63. -01). If the MIDI Bank setting is active for that instrument, IT will send
  64. it along with the note on message as well.
  65.  
  66. Summary
  67. -------
  68.  
  69. IT will always send a 'note on' command for a particular MIDI channel
  70. whenever a MIDI instrument is encountered in the pattern. (A MIDI instrument
  71. is simply an instrument where the MIDI Channel value has been set to
  72. something other than 0). IT will also send a program change command and/or a
  73. bank change command along with the note on command if they are set active.
  74.  
  75.  
  76. More Advanced MIDI
  77. ==================
  78.  
  79. How MIDI Works
  80. --------------
  81.  
  82. MIDI is not a file format (like IT is a module format) nor is it even a file
  83. layout. MIDI is a computer protocol (or language) which is used to
  84. communicate between devices . You may like to think of it as a network,
  85. where the MIDI cables are the cables yo u lay between computers, and MIDI is
  86. the network protocol (such as Novell NetWare, Windows Networking or TCP/IP)
  87. used to communicate between the sound devices. When an instrument is said to
  88. be 'MIDI compliant', that means that it has support for the MIDI protocol
  89. and understands MIDI messages.
  90.  
  91. The .MID file format is simply a way to store these messages. It is a
  92. collection of MIDI data, and when a .MID file is run through a MIDI player,
  93. all the MIDI player does is send the data in the .MID file out through the
  94. computer's MIDI port. In a network analogy, if you can imagine that every
  95. single transaction run through the network was being logged to a file on
  96. your hard disk; that every single byte was being recorded to a logfile, this
  97. is what a .MID file is.
  98.  
  99. An example of MIDI Communication in IT
  100. --------------------------------------
  101.  
  102. You've read above that when IT encounters a MIDI instrument in the
  103. patterndata, it sends a 'note on' command, which is defined in the MIDI
  104. protocol to be 'Play this note on this MIDI channel at this particular
  105. velocity'. (Velocity is similar to volume ). If you play a MIDI instrument
  106. which is mapped to MIDI channel 2 at C-5 with a velocity of 64, the actual
  107. data which IT sends out to the MIDI port resembles something like this (in
  108. hex):
  109.  
  110.     Note On with parameters;
  111.         MIDI Channel: 2
  112.         Note: C-5
  113.         Velocity: 64
  114.  
  115.         Data that IT sends out (hex): 91 3C 40
  116.         Data that IT sends out (decimal): 145 60 64
  117.  
  118. We'll run through each of these three bytes step by step.
  119.  
  120. The first byte (91 in hex, or 91h) is the actual 'Note on' command. It tells
  121. the receiving MIDI device that the data which follows is part of the 'note
  122. on' data. An analogy which trackers may find useful is the effect column.
  123. There, you have an effect command and effect data; for example, the effect
  124. 'G20' can be split up into two parts--'G' and '20'. The 'G' part is the
  125. actual effect command which tells IT that you wish to perform a portamento,
  126. and the '20' part is the effect data, or in this case the spe ed at which
  127. the portamento should occur. In this MIDI example, the '9' is the MIDI
  128. command and the '1 3C 40' is the rest of the data for that command.
  129.  
  130. Now, the second digit (1 in our example) specifies the MIDI channel. MIDI
  131. channels are 0-based; that is, if you want to send to MIDI channel 6, IT
  132. specifies 05 for the actual data. MIDI channel 10 is 09h, MIDI channel 14 is
  133. 0Dh, etc. Here we're sending t o MIDI channel 2, so the value sent out over
  134. MIDI is 01h.
  135.  
  136. The first byte (91 in hex, or 91h) is the actual 'Note on' command. It tells
  137. the receiving MIDI device that the data which follows is part of the 'note
  138. on' data. An analogy which trackers may find useful is the effect column.
  139. There, you have an effect com mand and effect data; for example, the effect
  140. 'G20' can be split up into two parts--'G' and '20'. The 'G' part is the
  141. actual effect command which tells IT that you wish to perform a portamento,
  142. and the '20' part is the effect data, or in this case the spe ed at which
  143. the portamento should occur. In this MIDI example, the '9' is the MIDI
  144. command and the '1 3C 40' is the rest of the data for that command.
  145.  
  146. Now, the second digit ('1' in our example) specifies the MIDI channel. MIDI
  147. channels are 0-based; that is, if you want to send to MIDI channel 6, IT
  148. specifies 05 for the actual data. MIDI channel 10 is 09h, MIDI channel 14 is
  149. 0Dh, etc. Here we're sending t o MIDI channel 2, so the value sent out over
  150. MIDI is 01h.
  151.  
  152. The second byte (3Ch) is actually the note to send (C-5 here). In MIDI, all
  153. command (parameter) data is between a scale of 00h-7Fh (or 0-127 in
  154. decimal). Notes are transmitted the same way - via numbers. If you imagine
  155. C-1 is sent with a value of 00h, C#1 i s 01h, D-2 is 02h, etc, then the note
  156. we want to play, C-5, has a value of 3Ch (60 decimal).
  157.  
  158. Now the first and second bytes are done with, the fourth byte should be
  159. fairly easy to understand. This byte represents the velocity at which the
  160. note should be played. In our case, we want a velocity of 64, which
  161. translates to 40h, and so this is the value which is sent out.
  162.  
  163. So to recap, we have three bytes for the note on command, "91 3C 40".
  164.  
  165.         Byte 1: 91 == Note on command (on MIDI channel #2)
  166.         Byte 2: 3C == Note on data (Note to play, C-5)
  167.         Byte 3: 40 == Note on data (Velocity of 64 decimal)
  168.  
  169. Configuring IT's MIDI out data
  170. ------------------------------
  171.  
  172. Keeping the above example in mind, press Shift-F1 to get to IT's MIDI screen
  173. and press the 'MIDI Output Configuration' button. This will take you to IT's
  174. MIDI out engine. Now, if you examine the 'Note On' field, it reads:
  175.  
  176.     9c n v
  177.  
  178. This can be correlated to our above example of '91 3C 40'. Now, the 'c n v'
  179. in the Note On field corresponds to 'channel', 'note' and 'velocity'. Think
  180. of them as variables; IT will substitute the appropriate channel, note and
  181. velocity values which it encounters in the MIDI instrument information
  182. and/or patterndata.
  183.  
  184. If you now actually defined a MIDI instrument to play on MIDI channel 2, and
  185. you played it in a pattern at C-5 with velocity 64, all IT does is read the
  186. 'Note On' field from the MIDI configuration screen and substitute '1' for
  187. 'c', '3C' (C-5) for 'n' and '64' for 'v'. Therefore, IT will read '9c n v'
  188. and replace it with '91 3C 40'.
  189.  
  190. In any of the MIDI output fields, lowercase letters represent variables (or
  191. subsitutions which IT should make) and uppercase letters or numbers are
  192. constants which IT writes to the MIDI port directly without any change.
  193. Therefore, these fields are case se nsitive--for the note on command, '9c n
  194. v' is blatantly different to '9C n v'. 9c represents 'send byte 09 followed
  195. by the MIDI channel byte', whereas 9C represents 'send the byte 9C'.
  196.  
  197. In short, 0-9 and A-F are treated as hexadecimal constants and will be
  198. passed through directly. Lowercase letters will be treated as variables and
  199. substituted accordingly. Note that variables are regarded as 'full bytes' by
  200. themselves and are never part of an actual byte sequence except for the
  201. variable 'c', so '9n' is exactly the same as '09 n' or '9 n'; all of them
  202. will expand to the sequence '09 <MIDI note byte>'. 'c' is the only value
  203. that takes on a nibble (4-byte) value, due to the MIDI protocol definition.
  204. This means that 9c will actually become one byte when expanded, with the
  205. lower digit representing the channel.
  206.  
  207. IT MIDI Variables
  208. -----------------
  209.  
  210. c: MIDI channel
  211.  
  212.         This is simply the MIDI channel of which the instrument is set
  213. to, 0-based. Note that this is the only nibble sized variable.
  214.  
  215. n: note value
  216.  
  217.     A value from 00-7Fh representing the note to be played, where
  218. C-5 is 60h. 
  219.  
  220. v: velocity
  221.  
  222.     The MIDI velocity of the note.
  223.  
  224. u: volume
  225.  
  226.     Volume is similar to velocity, except that velocity does not
  227. take the volume envelope and fadeout values into account, whereas the
  228. 'u' volume variable does. 
  229.  
  230. x: pan set
  231.  
  232.         Sends a MIDI panning value. This does not take into account
  233. panning envelopes.
  234.  
  235. y: calculated pan
  236.  
  237.         Sends a MIDI panning value which does take into account
  238. panning envelopes.
  239.  
  240. a: high byte of bank select
  241. b: low byte of bank select
  242.  
  243.     These commands are only really useful in the bank change
  244. field. 
  245.  
  246. z: macro data
  247.  
  248.     (See section on macros for full explanation).
  249.  
  250. Configuring MIDI Output for Your Keyboard
  251. -----------------------------------------
  252.  
  253. In the basic IT distribution, the only fields which have any data are 'Note
  254. on', 'Note Off' and 'Program Change'. The reason for this is that these are
  255. the only commands which are set as standards by MIDI. MIDI commands such as
  256. Change Pan, Bank Select , e tc all differ from synth to synth. There's not
  257. much which can be done to solve this, you will have to look up your synth's
  258. manual to find out the exact MIDI commands it needs to issue a panning
  259. change, bank select, etc.
  260.  
  261. Some values which you may wish to try, however, will be:
  262.  
  263.     Change pan: Bc 0A x
  264.     Bank select: Bc 0 a 20 b
  265.  
  266. These may or may not work. If they do, then great, but if they don't, you
  267. will have to actually RTFM *gasp* in order to get these other commands
  268. working.
  269.  
  270.  
  271. Effect Commands & Macros
  272. ========================
  273.  
  274. Now that IT's MIDI engine is understood and the basis of MIDI communication
  275. has been laid down, perhaps the most powerful function of IT's MIDI engine,
  276. macros, will be explained.
  277.  
  278. Standard Effects
  279. ----------------
  280.  
  281. Firstly, at the moment there is NO support for standard IT effect commands
  282. (such as pitch slide, portamento, vibrato etc) to work via MIDI. This may or
  283. may not be implemented in future. Currently, however, if you perform an E01
  284. effect on a note, nothing w ill happen as far as the MIDI aspect of the
  285. instrument is concerned.
  286.  
  287. Macro Effects - SFx
  288. -------------------
  289.  
  290. The SFx command, previously used in the .MOD format as "FunkRepeat", has
  291. been changed in IT to allow for the functioning of MIDI macros. The unused
  292. Zxx command will also now play a part in MIDI functioning.
  293.  
  294. To understand how this works, it's best to take an example into account. At
  295. the beginning of this supplement, the MIDI sequence '91 3C 40' was used
  296. which was a Note On, MIDI channel #2 played at C-5 with a velocity of 64.
  297. This was represented in IT's MIDI configuration as '9c n v', so it made the
  298. appropriate substitutions to '91 3C 40'.
  299.  
  300. The Macro Setup section of IT's MIDI Output Configuration screen can be used
  301. to define your own custom MIDI command/data sequences. These can be
  302. absolutely anything you like, from a MIDI SysEx command to a Note On
  303. command. In fact, to start off, we'll tak e a Note On sequence as an example
  304. and we will attempt to emulate the same '91 3C 40' bytes, except that we'll
  305. make this sequence ourselves rather than letting IT do the work for us.
  306.  
  307. How SFx and Zxx commands relate
  308. -------------------------------
  309.  
  310. Firstly, remember that IT substitutes values when it encounters variables.
  311. If you glance at the above section on IT MIDI Variables, you'll notice that
  312. the 'z' variable represents macro data. Now that this '91 3C 40' sequence
  313. has been driven into our he ads, try setting the SF0 macro field on IT's
  314. MIDI Output Configuration screen to '91 3C z'.
  315.  
  316. Remember that the fourth byte in the MIDI sequence (40 in our normal
  317. example) is the velocity to send with the Note On message. The SF0 macro
  318. field you've just defined means that IT will read any Zxx effects and
  319. replace the 'z' variable in the SF0 macro w ith the 'xx' value from the Zxx
  320. effect. To enable the macro, simply put in a SF0 along with a Note On in the
  321. pattern data. Now, all values from Z00 to Z7F will substitute for 'z'
  322. accordingly. So, to show that our SF0 sequence will reproduce the exact same
  323. thing as our Note On command:
  324.  
  325.     C-5 01 SF0 (this will play the note on command as usual, and
  326.                 specify that the SF0 macro sequence should be
  327.                 hooked to Zxx effects).
  328.     ... .. ...
  329.     ... .. ...
  330.     ... .. ...
  331.     ... .. Z40 (this will trigger our SF0 sequence with a 'z'
  332.                 value of 40h).
  333.  
  334. The above patterndata should produce a note on event at row 0 in the
  335. pattern, and again at row 4. Now, try replacing the Z40 effect with Z7F and
  336. IT will substitute 'z' with '7F', or a velocity of 7Fh (127 decimal) in our
  337. SF0 sequence. The result should be that you'll hear a Note On with velocity
  338. 64 on row 0, and a Note On with velocity 127 on row 4; ie: the second note
  339. triggered will be twice as loud. The The sequence that IT will send will be
  340. '91 3C 7F'.
  341.  
  342. SFx commands summary
  343. --------------------
  344.  
  345. Our example above of using a 'note on' command sequence for an SFx effect is
  346. rather pointless, since IT does this effect itself. However, it has
  347. hopefully served its purpose by demonstrating how effects work.
  348.  
  349. The SFx commands, as you can see, can be redefined to absolutely any MIDI
  350. data at all. This can be something simple like a pitch slide, a complex
  351. SysEx 'set filter to aftertouch' command, or whatever you like. The
  352. possibilities are endless and are only li mited by what your synth can do;
  353. IT's SFx/Zxx combination is customisable enough to handle nearly any MIDI
  354. data you wish to output.
  355.  
  356. If you wish to take advantage of these commands, you will have to look up
  357. the manual for your synth and get stuck into the MIDI/SysEx section. Please
  358. do not come to any IT support people asking for help on this subject because
  359. every synth is different.
  360.  
  361. Z80 -> ZFF commands
  362. -------------------
  363.  
  364. The Z80 to ZFF commands are also macro sequences, but they have no 'z'
  365. variable to substitute for. They are not 'hooked' to any SFx effects, they
  366. are straight, direct macro sequences. For example, if you have a MIDI
  367. controllable effects unit (such as an Alesis MidiVerb), you may wish to
  368. assign the Z80 command to set a up a certain value for the reverb delay
  369. length. Later in the song, you can issue a Z81 command to change the reverb
  370. delay or turn it off altogether.
  371.  
  372. To summarise, the Z80 to ZFF commands are similar to SFx macro sequences,
  373. but they do not have any extra parameters (whereas the SFx macro's 'z'
  374. variables are controlled by Z00 to Z7F).
  375.  
  376.  
  377. Contact Information
  378. ===================
  379.  
  380. If there are any problems with this textfile, email ozone@post1.com or
  381. pulse@student.adelaide.edu.au
  382.  
  383.   __/\___/\_/\____/\____/\ .. . Andre Pang % vault.kosmic ...:
  384.  
  385.  /   /__  /   \_    \_  __) :.. mailto:ozone@post1.com . ....:
  386. (  :  /  (__:  )  |  |  _)_ : . http://www.mindflux.com.au/ .:
  387.  \___(  ______/|__;__|_____| :. irc: #trax (irc.neato.org) ..:
  388.       \/ - #ozone
  389.  
  390.